﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;

public sealed class SqliteAdapter
{
    private static SQLiteConnection instance = null;
    private static readonly object padlock = new object();
    private static string conStr = @"data source=../../database/test.db";

    public static SQLiteConnection Instance
    {
        get
        {
            lock (padlock)
            {

                if (instance == null)
                {
                    instance = new SQLiteConnection(conStr);
                }
                return instance;
            }

        }

    }

    public static void Open()
    {
        if (instance != null)
            instance.Open();
    }
    public static void Close()
    {
        if (instance != null)
            instance.Close();
    }
}
